package team.xyg.cdtu2.controller;

import team.xyg.cdtu2.dto.PlatMapData;
import team.xyg.cdtu2.entity.AnchorList;
import team.xyg.cdtu2.service.AnchorListService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (AnchorList)表控制层
 *
 * @author makejava
 * @since 2022-06-28 08:54:24
 */
@RestController
@RequestMapping("anchorList")
public class AnchorListController {
    /**
     * 服务对象
     */
    @Resource
    private AnchorListService anchorListService;



    /**
     * 查询主播带货排行Top5
     *
     * @return
     */
    @GetMapping("anchorTop")
    public Map<String, Object> queryAnchorTop() {
        List<PlatMapData> list = anchorListService.queryAnchorTop();
        Map<String, Object> result = new HashMap<>();
        result.put("code", 200);
        result.put("message", "success");
        result.put("data", list);
        return result;
    }


}

